import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { AtNavBar } from 'taro-ui'

import './header.scss'
import { globalData } from '../../utils/common';

export class Header extends Component {

  constructor(props){
    super(props);
    this.state = {
      isFringe : 0,
    }
  }

  componentWillMount () { }

  componentDidMount () { }

  render () {
    const { isFringe } = globalData;
    console.log(globalData);
    const { leftIconType,  onClickLeftIcon, title } = this.props;
    return (
      <View>
        {
          <AtNavBar 
            className={`${isFringe ? "fringe" : "not-fringe"}`} 
            leftIconType={leftIconType}
            onClickLeftIcon={onClickLeftIcon}
            title={title}
            color='#fff'
            />
        }
      </View>
    )
  }
}